Skip to content

docs: Add zig lsp options #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

docs: Add zig lsp options #144

wants to merge 3 commits into from

Conversation

divakaivan
Copy link

@divakaivan divakaivan commented May 8, 2025

The Zig LSP config options are missing and it's unclear based on the Zig LSP docs what they are.

I am not sure which are the defalt options, but I went through all the zig lsp configs I could find on youtube and these are the options I found.

An additional chunk which auto formats imports is:

vim.api.nvim_create_autocmd("BufWritePre", {
  pattern = { "*.zig", "*.zon" },
  callback = function(ev)
    vim.lsp.buf.code_action({
      context = { only = { "source.organizeImports" } },
      apply = true,
    })
  end,
})

and it can be added above the usual return {...}, at the top of the file. Not sure if there is an option for that instead of this chunk which I got from the official docs.

enable_snippets = false,
warn_style = true,
highlight_global_var_declarations = false,
semantic_tokens = "full", -- full, partial, ???
Copy link
Author

@divakaivan divakaivan May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what are all the options here...

@divakaivan divakaivan closed this May 8, 2025
@divakaivan
Copy link
Author

All options are available here: https://github.com/zigtools/zls/blob/master/schema.json

@divakaivan divakaivan reopened this May 8, 2025
@divakaivan divakaivan closed this May 8, 2025
@divakaivan divakaivan reopened this May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant